<script setup lang="ts">
import { marked } from "marked";
import { ref, onMounted } from "vue";
import { readTextFile } from "@/utils/file";

defineOptions({
  name: "DocsIcon"
});

const markdownContent = ref("");

onMounted(async () => {
  try {
    // 修改文件路径为相对路径，从 public 目录访问
    const content = await readTextFile("/docs/icon.md");
    markdownContent.value = "" + marked(content);
  } catch (error) {
    console.error("读取Markdown文件失败:", error);
  }
});
</script>

<template>
  <div class="markdown-content" v-html="markdownContent" />
</template>
